﻿using DoNet.Core.Models;
using SqlSugar;
using System.ComponentModel;

namespace DoNet.Bpmn.Models
{
    /// <summary>
    /// 流程配置表，数据实体对象
    /// </summary>
    [SugarTable("Bpmn_Config", "流程配置表")]
    [Serializable]
    public class BpmnConfig : TenantEntity, ICreationAudited, IModificationAudited, IDeleteAudited
    {
        /*
        `id`                  int(11)             NOT NULL AUTO_INCREMENT COMMENT 'Auto Incr ID',
        `bpmn_code`           varchar(60)         NOT NULL DEFAULT '' COMMENT 'Process code',
        `bpmn_name`           varchar(60)         NOT NULL DEFAULT '' COMMENT 'Process Name',
        `bpmn_type`           int(11)                      DEFAULT NULL COMMENT 'Process Type',
        `form_code`           varchar(100)        NOT NULL DEFAULT '' COMMENT 'Process Business Code',
        `app_id`              int(11)                      DEFAULT NULL COMMENT 'associated app id',
        `deduplication_type`  int(11)             NOT NULL DEFAULT '1' COMMENT 'deduplication way 1.no deduplication,2 forward deduplication,3.backward deduplication',
        `effective_status`    int(11)             NOT NULL DEFAULT '0' COMMENT 'is effect 0:no 1:yes',
        `is_all`              int(11)             NOT NULL DEFAULT '0' COMMENT 'is to all,0 no 1yes',
        `is_out_side_process` int(11)                      DEFAULT '0' COMMENT 'is it a third party process',
        `is_lowcode_flow` tinyint default 0 null comment '是否是低代码审批流0,否,1是',
        `business_party_id`   int(11)                      DEFAULT NULL COMMENT 'its belong to business party',
        `extra_flags`         int                                           null,
        `remark`              varchar(255)        NOT NULL DEFAULT '' COMMENT 'remark',
        `is_del`              tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0:in use,1:delete',
        `create_user`         varchar(32)                  DEFAULT '' COMMENT 'as its name says',
        `create_time`         timestamp           NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'as its name says',
        `update_user`         varchar(32)                  DEFAULT '' COMMENT '更新人',
        `update_time`         timestamp            DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'as its name says'
        */
        /// <summary>
        /// 获取或设置 编号
        /// </summary>
        [DisplayName("编号")]
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "编号,主键")]
        public override long Id { get; set; }

        /// <summary>
        /// 流程编号
        /// </summary>
        [SugarColumn(ColumnDescription = "流程编号")]
        public virtual string BpmnCode { get; set; } = string.Empty;
        /// <summary>
        /// 流程名称
        /// </summary>
        [SugarColumn(ColumnDescription = "流程名称")]
        public virtual string BpmnName { get; set; } = string.Empty;
        /// <summary>
        /// 流程类别
        /// </summary>
        [SugarColumn(ColumnDescription = "流程类别")]
        public virtual int BpmnType { get; set; }
        /// <summary>
        /// 流程名称
        /// </summary>
        [SugarColumn(ColumnDescription = "流程名称")]
        public virtual string FormCode { get; set; } = string.Empty;
        /// <summary>
        /// 审批人去重方式
        /// 1 审批人不去重
        /// 2 审批人后去重
        /// 3 审批人前去重
        /// </summary>
        [SugarColumn(ColumnDescription = "审批人去重方式")]
        public virtual int DeduplicationType { get; set; } = 1;
        /// <summary>
        /// 有效标志
        /// </summary>
        [SugarColumn(ColumnDescription = "有效标志")]
        public virtual bool EnabledMark { get; set; } = false;

        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual bool IsAll { get; set; } = false;

        /// <summary>
        /// 是否第三方流程
        /// </summary>
        [SugarColumn(ColumnDescription = "是否第三方流程")]
        public virtual bool IsOutSideProcess { get; set; } = false;

        /// <summary>
        /// 是否是低代码审批流
        /// </summary>
        [SugarColumn(ColumnDescription = "是否是低代码审批流")]
        public virtual bool IsLowCodeFlow { get; set; } = false;

        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual int BusinessPartyId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual int ExtraFlags { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注")]
        public virtual string Description { get; set; } = string.Empty;

        /// <summary>
        /// 创建日期
        /// </summary>
        [SugarColumn(ColumnDescription = "创建日期")]
        public virtual DateTime? CreatorTime { get; set; }

        /// <summary>
        /// 创建用户主键
        /// </summary>
        [SugarColumn(ColumnDescription = "创建用户主键")]
        public virtual long? CreatorUserId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改时间")]
        public virtual DateTime? LastModifyTime { get; set; }

        /// <summary>
        /// 最后修改用户
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改用户")]
        public virtual long? LastModifyUserId { get; set; }

        /// <summary>
        /// 删除标志
        /// </summary>
        [SugarColumn(ColumnDescription = "删除标志")]
        public virtual bool DeleteMark { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [SugarColumn(ColumnDescription = "删除时间")]
        public virtual DateTime? DeleteTime { get; set; }

        /// <summary>
        /// 删除用户
        /// </summary>
        [SugarColumn(ColumnDescription = "删除用户")]
        public virtual long? DeleteUserId { get; set; }
    }
}
